﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LoginSystem
{
    class Orage
    {
public static DataTable GetDataTable(string sql)
        {
            //输出Sql数据的方法
            string conString = "server=PC-20190814AWMV;database=LoginSystem;uid=sa;pwd=1218";
            SqlConnection sqlconnection = new SqlConnection(conString);

            SqlDataAdapter DataAdapter = new SqlDataAdapter(sql, sqlconnection);

            DataTable dt = new DataTable();

            sqlconnection.Open();
            DataAdapter.Fill(dt);

            sqlconnection.Close();
            return dt;

            
        }


    }
}
